package com.swl.small.search.vo;

import lombok.Data;

import java.util.List;

/**
 * 封装页面所有可能传递过来的查询条件
 * 全文检索：skuTitle->keyword
 * 排序条件：saleCount(销量)、hotScore(热度分)、skuPrice(价格)
 * 过滤：hasStock、skuPrice区间、brandId、catalog3Id、attrs
 * 聚合：attrs
 * <p>
 * 完整查询：keyword=小米&sort=saleCount_desc/asc&hasStock=0/1
 * &skuPrice=400_1900&brandId=1&catalog3Id=1&attrs=1_3G:4G:5G
 * &attrs=2_骁龙845&attrs=4_高清屏
 */
@Data
public class SearchParam {

    private String keyword;
    //3级分类id
    private Long catalog3Id;

    /**
     * 排序条件
     * sort=saleCount_desc/asc
     * sort=skuPrice_desc/asc
     * sort=hotScore_desc/asc
     */
    private String sort;

    /**
     * 过滤条件
     * hasStock(是否有货)、skuPrice区间、brandId、catalog3Id、attrs
     * hasStock=0/1
     * skuPrice=0/1
     * skuPrice=1_500/_500/500_
     * brandId=1
     * attrs=1_3G:4G:5G
     */
    //是否有货
    private Integer hasStock;

    //价格区间
    private String skuPrice;

    //品牌id,多选
    private List<Long> brandId;

    //按照属性筛选
    private List<String> attrs;

    //页码
    private Integer pageNum;
}
